import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '合同编号',
    align: "center",
    dataIndex: 'contractCode'
  },
  {
    title: '合同名称',
    align: "center",
    dataIndex: 'contractName'
  },
  {
    title: '合同金额',
    align: "center",
    dataIndex: 'amount'
  },
  {
    title: '签约日期',
    align: "center",
    dataIndex: 'signDate',
    customRender:({text}) =>{
      text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
      return text;
    },
  },
  {
    title: '对接销售人员',
    align: "center",
    dataIndex: 'salesPersonId_dictText'
  },
  {
    title: '合同重点内容',
    align: "center",
    dataIndex: 'content'
  },
  {
    title: '合同录入人员',
    align: "center",
    dataIndex: 'recorder_dictText'
  },
  {
    title: '合同附件路径',
    align: "center",
    dataIndex: 'attachmentUrl'
  },
  {
    title: '客户',
    align: "center",
    dataIndex: 'customerId_dictText'
  },
  {
    title: '是否本周新增',
    align:"center",
    dataIndex: 'isNewWeek_dictText'
  },
];

// 高级查询数据
export const superQuerySchema = {
  contractCode: {title: '合同编号，默认日期字符串',order: 2,view: 'text', type: 'string',},
  contractName: {title: '合同名称',order: 3,view: 'text', type: 'string',},
  amount: {title: '合同金额',order: 4,view: 'number', type: 'number',},
  signDate: {title: '签约日期',order: 5,view: 'date', type: 'string',},
  salesPersonId: {title: '对接销售人员',order: 6,view: 'sel_search', type: 'string',dictTable: "f_sales_person", dictCode: 'id', dictText: 'name',},
  content: {title: '合同重点内容',order: 7,view: 'textarea', type: 'string',},
  recorder: {title: '合同录入人员',order: 8,view: 'sel_search', type: 'string',dictTable: "f_sales_person", dictCode: 'id', dictText: 'name',},
  attachmentUrl: {title: '合同附件路径',order: 9,view: 'text', type: 'string',},
  customerId: {title: '客户',order: 10,view: 'sel_search', type: 'string',dictTable: "f_customer", dictCode: 'id', dictText: 'customer_name',},
};
